//
//  miniGraphViewController.m
//  eyr
//
//  Created by Tor Gjøsæter on 4/26/12.
//  Copyright (c) 2012 University of Bergen. All rights reserved.
//

#import "MiniGraphVC.h"
#import "GraphVC.h"

@interface MiniGraphVC ()

@end

@implementation MiniGraphVC
@synthesize switchValue;
@synthesize importDate;
@synthesize graph;


@synthesize delegate;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
}

- (void)viewDidUnload
{
    [self setImportDate:nil];

    [self setSwitchValue:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (IBAction)switchGraph:(id)sender {
    //if off plot it, else unplot it
    
    if([delegate respondsToSelector:@selector(plot:)])
    {
        //send the delegate function with the amount entered by the user
        [delegate plotImportedGraph:self.graph];
    }

    
    NSLog(@"Switch");
    }
    

@end
